package soft.edu.service.Impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import soft.edu.common.ServerResponse;
import soft.edu.dao.SchScoreLevelMapper;
import soft.edu.pojo.SchScoreLevel;
import soft.edu.service.SchScoreLevelService;

import java.util.List;

@Controller("schScoreLevelService")
public class SchScoreLevelServiceImpl implements SchScoreLevelService {

    @Autowired
    private SchScoreLevelMapper schScoreLevelMapper;

//    根据院校名查分数信息
    @Override
    public ServerResponse<List<SchScoreLevel>> getInfo
            (String year,String sco_uni_name, String sco_college_name, String sco_maj_name) {
        List<SchScoreLevel> listSchScoreLevel = schScoreLevelMapper.getInfo
                (year,sco_uni_name, sco_college_name, sco_maj_name);
        if(listSchScoreLevel.isEmpty()){
            return ServerResponse.createByError("分数信息查询不到");
        }else{
            return ServerResponse.createBySuccess("分数信息查询成功",listSchScoreLevel);
        }
    }
}
